<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>系统登录</title>
  <link rel="stylesheet" th:href="@{/css/login.css}">
  <script type="text/javascript" th:src="@{/js/jquery.min.js}"></script>
  <script th:src="@{/lib/layui/layui.js}" charset="utf-8"></script>
</head>
<body class="login-bg">

    <div class="login">
        <div class="message">系统登录</div>
        <div class="alert alert-info">
            请输入用户名和密码登录
        </div>
        <div id="darkbannerwrap"></div>

            <input name="username" placeholder="用户名" id="login_code" type="text" lay-verify="required" class="layui-input" >
            <hr class="hr15">
            <input name="password" lay-verify="required" id="password" placeholder="密码"  type="password" class="layui-input">
            <hr class="hr15">
            <input value="登录" lay-submit lay-filter="login" style="width:100%;" type="submit" id="loginBtn">
            <hr class="hr20" >
    </div>
    <script>
            layui.use(['element','laypage','layer','form'], function() {
                $ = layui.jquery;
                var form = layui.form(),
                layer = layui.layer;

                $("#loginBtn").click(function(){
                    var login_code = $('#login_code').val();
                    var password = $('#password').val();
                    $.ajax({
                        type:"post",
                        url:"/login/doLogin.html",
                        data: {
                            login_code: login_code,
                            password:password
                        },
                        dataType:"json",
                        success:function(data){
                            if(data.status==1){
                                location.href='/index/index.html';
                            }else{
                                layer.msg(data.msg,{icon:5,time:1000});
                                return false;
                            }
                        }
                    });
                });

            });

        </script>

    
    <!-- 底部结束 -->
    
</body>
</html>